
#pragma once

#include <ttg/all.h>
#include "serialPrimes.h"
#include "ttgPrimes.h"
#include "tbbPrimes.h"

int main()
{
	//Initing.
	ttg::services::Services s(true);
	printf("TBB vs TTG: Primes\n");
	printf("CPU type: %s\n\n", ttg::services::CPUAnalyzer::getRef()->getCPUInfo());
	//Serial version.
	printf("Serial version ...\n");
	std::pair<uint64, double> serialResult = serialPrimes(1000000000);
	printf("   Result: %d\n   Elapsed time: %f seconds\n",
		   (int)serialResult.first, serialResult.second);
	//Serial version.
	printf("tbb::reduce version ...\n");
	std::pair<uint64, double> tbbResult = tbbPrimes(1000000000);
	printf("   Result: %d\n   Elapsed time: %f seconds\n",
		   (int)tbbResult.first, tbbResult.second);
	//ttgLib version.
	printf("ttg::pipeline ...\n");
	std::pair<uint64, double> ttgResult = ttgPrimes(1000000000);
	printf("   Result: %d\n   Elapsed time: %f seconds\n",
		   (int)ttgResult.first, ttgResult.second);
	return 0;
}
